home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-21 / qemm7ref.zip / STLTECH.TEC < prev    next >
Text File  |  1993-06-08  |  18KB  |  325 lines

  1.  
  2.                 QEMM's Stealth ROM Technology
  3.  
  4.  
  5.   This QEMM 7 technote is available from the following sources:
  6.  
  7.   Quarterdeck Technical Support BBS:  STLTECH.TEC
  8.                          CompuServe:  STTECH.ZIP
  9.                               Q/FAX:  #168
  10.  
  11.  
  12.   Subject: An overview of QEMM's Stealth ROM technology -- how it
  13.   works, why it works so well, and what can cause complications for
  14.   it.
  15.  
  16.   PLEASE NOTE:  Unless otherwise indicated, references to the 386
  17.   processor include all 386 and higher processors.
  18.  
  19.   Q: What is Stealth ROM?
  20.   Q: How does Stealth ROM work?
  21.   Q: What is the difference between ST:M and ST:F?
  22.   Q: Which Stealth ROM strategy is preferable?
  23.   Q: What machines are supported by QEMM's Stealth ROM?
  24.   Q: Does Stealth ROM slow down my system?
  25.   Q: How can Stealth ROM fail?
  26.   Q: If I'm having problems with Stealth ROM, what should I do?
  27.  
  28.   Q: What is Stealth ROM?
  29.   -----------------------
  30.   Traditionally, 386 memory managers such as QEMM have been able to
  31.   create High RAM by associating physical extended memory with
  32.   unused addresses between 640K and 1MB.  Quarterdeck's Stealth ROM
  33.   technology is QEMM's method of creating more High RAM than
  34.   previously thought possible, by mapping memory to addresses that
  35.   are used by system, video, disk, and other ROMs.
  36.  
  37.   Q. How does Stealth ROM work?
  38.   -----------------------------
  39.   To understand how Stealth ROM works, it is useful to understand
  40.   the concept of MAPPING.  MAPPING is the process by which memory
  41.   management hardware and software can make memory appear in
  42.   appropriate places at appropriate times; it is the process of
  43.   associating memory with an address.  The expanded memory
  44.   specification (EMS) uses mapping to make portions of expanded
  45.   memory appear inside the EMS Page Frame when that memory is
  46.   requested by a program.  When a program needs more memory than
  47.   what is normally available to it under DOS, it can request that
  48.   some expanded memory be allocated from either an EMS board, or
  49.   from the EMS memory created by a 386 expanded memory manager.
  50.  
  51.   Expanded memory has no DOS addresses of its own, but can be made
  52.   to appear at a valid DOS address -- "mapped in".  Expanded memory
  53.   pages that are not currently needed may be "mapped out" --
  54.   relieved of their DOS addresses and put back into the expanded
  55.   memory pool, with code and data still intact.  When the
  56.   application needs these pages, they are "mapped in" to the EMS
  57.   Page Frame again.  It is therefore possible for a program that
  58.   uses expanded memory to have access to much more memory than DOS
  59.   itself can see of its own accord. You may know this technology as
  60.   "bank switching", which is one of the techniques used to extend
  61.   and add power to everything from mainframe computers to high-end
  62.   UNIX systems... to DOS machines!
  63.  
  64.   Mapping is also useful for creating High RAM; in the same way as
  65.   detailed above, expanded memory can be associated with unused
  66.   addresses between 640K and 1MB.  The EMS hardware and software
  67.   cooperate to make memory appear where there is otherwise none.
  68.  
  69.   Stealth ROM uses mapping for a new purpose.  The 386 chip can be
  70.   made to map memory in or out of DOS' address space at any time.
  71.   Stealth ROM uses 386 mapping to map system, disk, or video ROMs
  72.   in and out of DOS' address space when appropriate, using one of
  73.   two strategies -- ST:M and ST:F.
  74.  
  75.   Q. What is the difference between ST:M and ST:F?
  76.   ------------------------------------------------
  77.   ROMs on your system are accessed via interrupts -- which are
  78.   conceptually similar to BASIC subroutines.  When your system
  79.   boots up, it sets up something called an interrupt vector table.
  80.   This is a list of addresses where specific ROM subroutines can be
  81.   found.  When a program on your system needs a certain ROM
  82.   function (for example, writing coloured text to the screen), it
  83.   sets up some data in appropriate places, and then calls the
  84.   interrupt with a processor INT instruction.  The processor then
  85.   looks at the interrupt vector table to find out the address where
  86.   the ROM function can be found.  The calling program jumps to that
  87.   address, the ROM subroutine gets run, and then control is
  88.   returned to the calling program.
  89.  
  90.   When you use Stealth ROM, as your system boots QEMM takes control
  91.   of interrupts that are in use by the ROMs on your system and
  92.   points those interrupts into itself.  This way, QEMM can monitor
  93.   exactly when a ROM interrupt occurs, and can manage the interrupt
  94.   appropriately.
  95.  
  96.   When you use ST:M ("Map Mode"), QEMM maps system, video, disk
  97.   ROMs, and any other "Stealthable" ROMs out of the first megabyte
  98.   to addresses elsewhere in the processor's memory map.  QEMM can
  99.   then map memory from your "pool" of expanded memory into these
  100.   addresses, created additional High RAM into which you can load
  101.   device drivers and memory resident programs.  (For information on
  102.   what is "Stealthable", see "How can Stealth ROM fail?" below.)
  103.   When the ROM is needed by the system, QEMM maps the appropriate
  104.   ROM code into the expanded memory Page Frame.  The ROM code now
  105.   has a valid DOS address at which it can execute, and it does so
  106.   normally.  When the ROM routine is finished, QEMM then remaps the
  107.   ROM elsewhere outside of DOS' address space.
  108.  
  109.   When you use ST:F ("Frame Mode"), QEMM leaves the system, video,
  110.   and disk ROMs where they are normally found.  QEMM then maps the
  111.   EMS Page Frame to such that it lies on top of a ROM.  Expanded
  112.   memory can then be mapped into the EMS Page Frame.  When the ROM
  113.   that has been hidden by the Page Frame is needed, QEMM
  114.   momentarily disables expanded memory usage and maps the Page
  115.   Frame out of DOS' address space, exposing the ROM beneath.  The
  116.   ROM code then executes normally.  When the ROM routine is
  117.   finished, QEMM can then re-enable the EMS Page Frame, and lie it
  118.   back down over the ROM.
  119.  
  120.   Q. Which Stealth ROM strategy is preferable?
  121.   -------------------------------------------
  122.   Since ST:M is capable of mapping almost all ROMs out of DOS'
  123.   address space, and thus leaves you with much more High RAM, it is
  124.   the better of the two options.  ST:F is needed on a very small
  125.   number of systems; its object is to ensure compatibility with
  126.   machines that have ROMs that jump to each other without using an
  127.   interrupt to do so.
  128.  
  129.   Q. I have to have a special version of QEMM so that Stealth ROM
  130.   will work on my system, right?  My system has to be one that
  131.   Stealth ROM knows about, right?
  132.   ------------------------------------------------------------------
  133.   No to both questions!  Stealth ROM is designed to work on ANY
  134.   system, regardless of brand, model, or ROM BIOS revision.  You do
  135.   not need a special version of QEMM or Stealth ROM that has been
  136.   customized for your machine, because Stealth ROM's strategy
  137.   merely remaps you ROMs instead of replacing them.  Stealth ROM
  138.   does not modify, compress or replace your ROM BIOS, and it does
  139.   not depend on being aware of the brand or revision of your ROMs.
  140.   Additionally, Stealth ROM will typically create more High RAM on
  141.   your system than any other memory management technique.  You do
  142.   not have to disable any of QEMM's features -- EMS, XMS, DPMI, or
  143.   VCPI memory management -- as other memory managers force you to
  144.   do in order to squeeze every last byte of High RAM from your
  145.   system.
  146.  
  147.   Q. Does Stealth ROM slow my system down?
  148.   ----------------------------------------
  149.   Stealth ROM does add some tiny amount of overhead to ROM BIOS
  150.   interrupts. Since most application programs spend very little
  151.   time calling ROM code, the slowdowns are usually imperceptible or
  152.   insignificant to the user.  Ironically, since benchmark programs
  153.   often call ROM interrupts repeatedly (some do almost nothing but
  154.   this), the greatest slowdown will be seen in benchmark results;
  155.   these results rarely have much to do with the speed of useful
  156.   programs, however.  Since your application programs typically
  157.   have much more conventional memory to deal with when Stealth ROM
  158.   is invoked, you are much more  likely to observe faster
  159.   performance.  It should be noted that QEMM's ROM parameter can
  160.   provide significant performance increases.  Using Stealth ROM
  161.   along with the ROM parameter is typically significantly faster
  162.   than not using QEMM at all.
  163.  
  164.   Q. How can Stealth ROM fail?
  165.   ----------------------------
  166.   Stealth ROM is a robust and proven technology.  However, some
  167.   programs and some system ROM implementations can interfere with
  168.   Stealth ROM's strategies. Note that the problems described here
  169.   are infrequent and/or system-specific. Most users will experience
  170.   no difficulty at all with Stealth ROM.
  171.  
  172.   Note that in the above description of how Stealth ROM works, each
  173.   strategy depends on a processor interrupt being asserted.  This
  174.   is the normal way of calling a piece of ROM code; processor
  175.   registers are loaded with data and with information which denotes
  176.   exactly which ROM service is being requested, and then a
  177.   processor INT instruction is called.  BASIC programmers will
  178.   recognize that this is similar to the process of loading a few
  179.   variables with data, and then calling a subroutine with a GOSUB
  180.   instruction; most good texts favour this method of programming.
  181.   However, it is possible (though relatively uncommon) for a piece
  182.   of ROM code to JUMP to a specific address without asserting an
  183.   interrupt.  This is analogous to a BASIC GOTO, rather than a
  184.   GOSUB; GOTOs are frowned upon by expert programmers, since a GOTO
  185.   presumes that the address to which the code is jumping will
  186.   remain constant and unchanging.  This is less of a problem if one
  187.   person writes all the code, since it is easier for one person to
  188.   keep track of the proper destination addresses; when more than
  189.   one person is involved, it's more difficult to determine why and
  190.   where the code should branch.
  191.  
  192.   Prudent programmers do not depend on ROM code being at a specific
  193.   address, since the code's address could easily vary when the ROM
  194.   code is revised (and, like any software, ROM code is constantly
  195.   under revision). Programs that jump to an invalid ROM address
  196.   (and therefore invalid code) will quickly crash in ANY
  197.   circumstance.  In the case of a direct jump to ROM code when
  198.   Stealth ROM is invoked, QEMM will not be able to intercept an
  199.   interrupt, and thus may not have a chance to make sure that the
  200.   appropriate portion of the ROM code is mapped into the Page Frame
  201.   (ST:M).  In such circumstances, ST:F may be helpful, since the
  202.   Page Frame will be made to disappear, exposing the ROM beneath,
  203.   and will not reappear until after the ROM BIOS call is completely
  204.   done.
  205.  
  206.   * Many ROM-BIOS-based system setup programs exhibit this same
  207.   sort of behaviour, as do installation routines for some video
  208.   cards. If you wish to run such programs, it is far better to
  209.   disable QEMM temporarily than to sacrifice the large amounts of
  210.   extra High RAM that ST:M can provide.  Setup programs should need
  211.   to be run infrequently, and typically require a reboot before the
  212.   modified settings take effect. High RAM is generally much more
  213.   useful.  It is worth weighing the benefits of instant access to
  214.   your setup program against the extra High RAM that Stealth ROM
  215.   can provide; the decision should not be a difficult one.
  216.  
  217.   The easiest way to deal with this is to disable QEMM, run your
  218.   Setup program, and reboot with QEMM active again.  To disable
  219.   QEMM temporarily, hold down the <Alt> key immediately after you
  220.   hear a beep on bootup.  QEMM will post a message telling you to
  221.   press <Escape> to unload QEMM, or any other key to continue with
  222.   QEMM.  Press <Escape>, and run your Setup program.  (If you are
  223.   using the DOS-UP feature from QEMM version 7.0 you will first see
  224.   a message asking if you want to unload DOSDATA.  Press <Escape> to
  225.   unload DOS-UP, then hold down the <Alt> key again until you see
  226.   the message telling you to press <Escape> to unload QEMM.  After
  227.   unloading QEMM, run your Setup program, then reboot the machine
  228.   normally (without holding down <Alt>; your revised Setup will be
  229.   in effect, and so will QEMM.
  230.  
  231.   * Some programs find the address of a given piece of ROM at
  232.   startup, and then jump directly to that address later on, at a
  233.   time when the ROM may not be mapped into memory.  Programs like
  234.   these will often require that a portion of the ROM be EXCLUDEd on
  235.   the QEMM386.SYS line in CONFIG.SYS.
  236.  
  237.   * Some ROMs do not have any interrupts pointing to them at
  238.   startup.  If this is the case, QEMM will not be able to detect
  239.   where a given interrupt should point, and thus may not invoke
  240.   Stealth ROM for that ROM.  Some device drivers refuse to load
  241.   unless they see an interrupt pointing to its normal location;
  242.   these programs can be loaded before QEMM if necessary.
  243.  
  244.   * Some programs make invalid assumptions about the EMS Page
  245.   Frame.  In some cases, programs assume that the state of the EMS
  246.   Page Frame will remain unchanged even after they abandon an EMS
  247.   handle; this is akin to assuming that you can get your property
  248.   back after leaving it at the end of the driveway on garbage pick-
  249.   up day.  This fails with Stealth ROM because, by default, the
  250.   Page Frame is immediately unmapped after a handle has been
  251.   abandoned -- as if, in the above example, the city picks up the
  252.   garbage pretty much immediately --as soon as you get back into
  253.   your house.  The UFP:N parameter suppresses this feature, perhaps
  254.   at the expense of some speed.
  255.  
  256.   * Some applications assume that the contents of the Page Frame
  257.   will be preserved across a hardware interrupt -- like assuming
  258.   that your coat will never get moved from the place in which you
  259.   saw the cloakroom attendant put it.  This is an invalid
  260.   assumption, and can cause problems not only with Stealth ROM, but
  261.   with EMS-using TSRs as well.
  262.  
  263.   * Other programs outright violate the Expanded Memory
  264.   Specification by placing their interrupt stacks in the Page
  265.   Frame.  This is not simply a problem for Stealth ROM or for QEMM;
  266.   this can cause a conflict with programs using expanded memory and
  267.   ANY expanded memory manager.
  268.  
  269.   Fortunately, programs that exhibit the above problems are rare.
  270.   If you experience difficulty that is found to be Stealth-related,
  271.   you might wish to encourage the developer of the faulting program
  272.   to make the program more compatible with Stealth ROM.
  273.   Quarterdeck is very happy to assist the developer of any
  274.   commercial hardware or software who wishes added compatibility
  275.   with our products.
  276.  
  277.   ROM code is normally read 8 or 16 bits at a time, and 32-bit RAM
  278.   is therefore much faster.  (You can see this in action by looking
  279.   at Manifest First Meg / Timings, first without the ROM parameter
  280.   on the QEMM386.SYS line in CONFIG.SYS, and then with ROM added to
  281.   the end of that line.) Some video ROM speed-up drivers
  282.   (TVGABIO.SYS, RAMBIOS.SYS, FASTBIOS.SYS, SPEED_UP.SYS... these
  283.   typically come on the utilities diskettes provided with your
  284.   video card) work by copying the contents of video ROM to
  285.   conventional RAM.  These programs will often fail if Stealth ROM
  286.   is active; again, they assume that the video ROM is in its normal
  287.   place, and has not been moved by Stealth ROM.  QEMM's ROM
  288.   parameter provides the same feature as these drivers do, with
  289.   three important advantages:  first, QEMM copies the video ROM
  290.   into 32-bit RAM, and then write-protects the RAM so that some
  291.   errant program does not overwrite the ROM code.  Second, QEMM's
  292.   ROM parameter costs neither conventional memory nor High RAM to
  293.   provide this feature -- the video drivers mentioned above will
  294.   typically take 32K of one or the other.  Finally, the ROM
  295.   parameter is fully compatible with Stealth ROM.
  296.  
  297.   Q. If I experience a problem when using Stealth ROM, what should
  298.   I do?
  299.   ------------------------------------------------------------------
  300.   Stealth ROM problems can be resolved by consulting Quarterdeck
  301.   Technical Note #205, "Troubleshooting Stealth ROM" (STEALTH.TEC).
  302.   This technote was installed in your QEMM\TECHNOTE directory when
  303.   you installed QEMM 7.
  304.  
  305.   SUMMARY
  306.   -------
  307.   Stealth ROM is a robust and proven technology.  It is an easy-to-
  308.   use, safe, and efficient way of creating more High RAM on your
  309.   system, providing more memory for your TSRs, your device drivers,
  310.   DESQview 386, MS Windows, and your application programs.  It is
  311.   likely to speed up your system rather than slowing it down.  It
  312.   is designed to be effective on any 386 or higher processor,
  313.   regardless of the ROM's manufacturer or version.  Programs that
  314.   cause conflicts with Stealth ROM are apt to cause problems with
  315.   other programs and memory managers.  Stealth conflicts are rare,
  316.   and troubleshooting is straightforward.  Stealth ROM is the
  317.   easiest way to provide the optimal amount of High RAM on your
  318.   system.
  319.  
  320.   ***************************************************************
  321.             Trademarks are property of their respective owners.
  322.    This technical note may be copied and distributed freely as long
  323.   as it is distributed in its entirety and it is not distributed
  324.   for profit.  Copyright (C) 1993 by Quarterdeck Office Systems
  325.   ****************** E N D   O F   F I L E ***********************